package org.example.struct.array;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liyishan
 * @date 2023/12/26 10:15
 * @apiNote
 */

public class Test01431KidsWithCandies {

    public static List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
        int max = Integer.MIN_VALUE;
        for(int i = 0; i < candies.length; i++){
            max = Math.max(max, candies[i]);
        }
        List<Boolean> result = new ArrayList<>();
        for(int i = 0; i < candies.length; i++){
            int  temp = candies[i] + extraCandies;
            if(temp >= max){
                result.add(true);
            }else{
                result.add(false);
            }
        }
        return result;
    }
}
